package com.zrh.jsd.service.studydemo.common_test;

import lombok.extern.slf4j.Slf4j;

import java.util.stream.IntStream;

@Slf4j
public class CommonException3 {

    public static void main(String[] args) {
        Data.reset();
        IntStream.rangeClosed(1, 1000000).parallel().forEach(i -> new Data().wrong());
        System.out.println(Data.getCounter());

        Data.reset();
        IntStream.rangeClosed(1, 1000000).parallel().forEach(i -> new Data().right());
        System.out.println(Data.getCounter());
    }
}
